﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nova.Parsing.Tokens;
using Nova.Parsing.GoldParser.Semantic;

namespace Nova.Parsing.Constructs
{
    public abstract class ValueConstruct : NovaConstruct
    {
        
    }

    public sealed class ValueExpression : ValueConstruct
    {
        private ExpressionConstruct m_Expression;

        [Rule(@"<Value> ::= '(' <Expression> ')'")]
        public ValueExpression(IgnoredToken iA, ExpressionConstruct expression, IgnoredToken iB)
        {
            m_Expression = expression;
        }

        public ExpressionConstruct Expression
        {
            get { return m_Expression; }
        }
    }

    public sealed class ValueConstant : ValueConstruct
    {
        private ValueToken m_Value;

        [Rule(@"<Value> ::= <Constant>")]
        public ValueConstant(ValueToken value)
        {
            m_Value = value;
        }

        public ValueToken Value
        {
            get { return m_Value; }
        }
    }

    public sealed class ValueVariable : ValueConstruct
    {
        private VariableConstruct m_Variable;

        [Rule(@"<Value> ::= <Variable Iden>")]
        public ValueVariable(VariableConstruct var)
        {
            m_Variable = var;
        }

        public VariableConstruct Variable
        {
            get { return m_Variable; }
        }
    }
}
